package org.example.springboot.thymeleaf;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;
import java.util.Map;

@Controller
public class HomeController {

    @GetMapping("/thymeleaf")
    public String toMain (Map<String, Object> map) {
        map.put("title", "Thymeleaf DEMO");
        map.put("content", "hello, Thymeleaf DEMO...");
        map.put("contents", Arrays.asList("vue", "elementUI", "springboot", "thymeleaf", "springdata-jpa", "mybatis"));
        // 返回页面：src/main/resources/templates/ + main + .html
        return "main";
    }
}
